#!/bin/bash
#备份最后一天所有修改的文件

# step1 des-file
dst_default=backup-$(date +"%Y-%m-%d")
archive=${1:-$dst_default}
echo -e "saved in $archive"

# step2 search files to backup
tar cf - `find . -mtime -1 -type f -print` > ${archive}.tar
gzip ${archive}.tar

echo "backup success"
exit 0
